package com.sgu6.sgu6_machine.ui.dialog.proxy;

import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;

import com.sgu6.sgu6_machine.container.ComContainer;
import com.sgu6.sgu6_machine.container.MachineContainer;

import butterknife.Unbinder;

public class ProxyDialogFragment extends DialogFragment {

    protected final String TAG = this.getClass().getSimpleName();
    protected Unbinder unbinder;

    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        if (requireContext() == null) {
            return super.onCreateDialog(savedInstanceState);
        }
        return new ProxyDialog(getContext(), getTheme());
    }


    @Override
    public void onDismiss(@NonNull DialogInterface dialog) {
        super.onDismiss(dialog);
        MachineContainer.isConsumption = true;
    }
}
